<template>
	<view class="custom-content">
		<scroll-view scroll-y="true" >
			
		<view class="box">
			<text class="time">今天 {{time}}</text>
			<view class="openmsg">{{openMsg}}</view>

			<view class="contents">
				<!-- 猜你想问 -->
				<view class="cleft">
					<text>猜您想问</text>
					<view class="" class="cleftb">
						<text>换一批</text>
					</view>
				</view>
				<!-- 常见问题 -->
				<view class="cright">
					<view><text>什么时候更新设备?</text>
						<image src="../../static/shebei/go.png" mode="" class="right-go"></image>
					</view>
					<view><text>什么时候更新数据?</text>
						<image src="../../static/shebei/go.png" mode="" class="right-go"></image>
					</view>
					<view><text>HNT的兑换率是多少?</text>
						<image src="../../static/shebei/go.png" mode="" class="right-go"></image>
					</view>
					<view><text>HNT的总托管分红怎么算？</text>
						<image src="../../static/shebei/go.png" mode="" class="right-go"></image>
					</view>
				</view>
			</view>

			<!-- 滚动切换 -->
			<swiper next-margin="210px">
				<swiper-item >
					<view class="swiper-item"><view><image src="../../static/custom/appraise.png" mode=""></image><view>评价管理</view></view></view>
				</swiper-item>
				<swiper-item>
					<view class="swiper-item"><view><image src="../../static/custom/money.png" mode=""></image><view>资产查询</view></view></view>
				</swiper-item>
				<swiper-item>
					<view class="swiper-item"><view><image src="../../static/custom/active.png" mode=""></image><view>激活设备</view></view></view>
				</swiper-item>
				<swiper-item>
					<view class="swiper-item"><view><image src="../../static/custom/node.png" mode=""></image><view>节点管理</view></view></view>
				</swiper-item><swiper-item>
					<view class="swiper-item"><view><image src="../../static/custom/push.png" mode=""></image><view>推广收益</view></view></view>
				</swiper-item>
			</swiper>
		</view>
		</scroll-view>
		<view class="user">
			<!-- 用户操作 -->
			<view class="userT">
				<view>
					<image src="../../static/custom/order.png" mode=""></image>咨询订单问题
				</view>
				<view>
					<image src="../../static/custom/sAppraise.png" mode=""></image>服务评价
				</view>
			</view>
			<!-- 用户输入 -->
			<view class="userEnter">
				<input type="text" placeholder="请输入想咨询的问题" @focus="key" @blur="outblur">
				<image src="../../static/custom/add.png" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components:{
			
		},
		data() {
			return {
				openMsg: 'Hi,您好!欢迎咨询HNT设备,您有什么疑问,我来帮您~',

			}
		},
		computed: {
			time() {
				var date = new Date;
				var h = date.getHours();
				var m = date.getMinutes()

				if (h < 10 || m < 10) {
					h = '0' + h;
					m = '0' + m
				}
				return h + ':' + m
			}
		},
		methods: {
		key(){
			uni.getSelectedTextRange({
			  success: res => {
			    console.log('getSelectedTextRange res', res.start, res.end)
			  }
			})
		},
		// 失去焦点
		outblur(){
			uni.hideKeyboard()
		}
		}
	}
</script>

<style scoped>
	.custom-content {
		background-color: #F3F3F3;
		height: 94.6vh;
	}

	.box {
		text-align: center;
		height: 85vh;
	}

	.time {
		opacity: .7;
		font-size: .7em;
	}

	.openmsg {
		width: 70%;
		text-align: left;
		box-shadow: 0 0 6rpx 6rpx rgba(0, 0, 0, .06);
		border-radius: 16rpx;
		margin: 40rpx 0;
		margin-left: 40rpx;
		font-size: 1em;
		opacity: .7;
	}

	.contents {
		width: 70%;
		margin-left: 40rpx;
		box-shadow: 0 0 6rpx 6rpx rgba(0, 0, 0, .06);
		border-radius: 16rpx;
		display: flex;
	}

	.cleft {
		width: 160rpx;
		height: 300rpx;
		position: relative;
	}

	.cleft>text:nth-of-type(1) {
		font-size: 2.1em;
		color: #005FDB;
		position: relative;
		top: 30rpx;
	}

	.cleftb {
		position: absolute;
		bottom: 10rpx;
		font-size: .5em;
		left: 30rpx;
		opacity: .5;
	}

	.cright {
		position: relative;
		text-align: left;
		margin-left: 20rpx;
	}

	.cright>view {
		margin: 40rpx 0;
		font-size: .7em;
		opacity: .7;
	}

	.right-go {
		width: 20rpx;
		height: 20rpx;
		float: right;
		padding-top: 6rpx;
	}
	swiper{
		margin: auto;
		margin-top: 80rpx;
		width: 80%;
		height: 200rpx;
	}
	.swiper-item{
		width: 136rpx;
		height: 200rpx;
		box-shadow: 0 0 6rpx 10rpx rgba(0,0,0,.06);
		border-radius: 24rpx;
	}
	.swiper-item>view>image{
		width: 60rpx;
		height: 40rpx;
		margin-top: 40rpx;
	}
	.swiper-item>view>view{
		margin-top: 60rpx;
	}
	.user {
		position: relative;
	}

	.userT {
		width: 70%;
		height: 60rpx;
		display: flex;
		border-radius: 16rpx;
		margin-bottom: 6rpx;
		margin-left: 16rpx;
	}

	.userT>view {
		margin: 0 20rpx;
		height: 50rpx;
		font-size: .7em;
		box-shadow: 0px 10rpx 60rpx rgba(0, 0, 0, 0.06);
		line-height: 50rpx;
		border-radius: 32rpx;
		background-color: #FFFFFF;
		padding: 0 20rpx;
	}

	.userT>view>text {
		padding: 0 20rpx;
	}

	.userT>view>image {
		width: 30rpx;
		height: 30rpx;
		margin-right: 16rpx;
		position: relative;
		top: 10rpx;
	}

	.userEnter {
		width: 100%;
		position: relative;
	}

	.userEnter>input {
		width: 70%;
		border: 2rpx solid #FFFFFF;
		background-color: #FFFFFF;
		font-size: .6em;
		height: 60rpx;
		padding-left: 30rpx;
		margin-left: 30rpx;
		border-radius: 30rpx;
	}

	.userEnter>image {
		width: 110rpx;
		height: 110rpx;
		position: absolute;
		top: -20rpx;
		right: 30rpx;
	}
</style>
